﻿<controls:ChildWindow xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           x:Class="SmartSpace.UI.Silverlight.Dynamic.Windows.SelectMultiOrgWindow"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="400" Height="300"  
           Title="SelectOrgWindow">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <sdk:TreeView Name="_ctlTreeOrg" Grid.Row="0">
            <sdk:TreeView.ItemTemplate>
                <sdk:HierarchicalDataTemplate ItemsSource="{Binding Path=[Children]}">
                    <CheckBox IsChecked="{Binding Path=[IsSelected]}" VerticalAlignment="Center">
                        <TextBlock Text="{Binding Path=[Caption]}"/>
                    </CheckBox>
                </sdk:HierarchicalDataTemplate>
            </sdk:TreeView.ItemTemplate>
        </sdk:TreeView>
        <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
            <Button x:Name="OKButton" Click="OKButton_Click">
                <StackPanel>
                    <Image Source="../Resources/Accept.png" Margin="0,0,5,0"/>
                    <TextBlock Text="选择"/>
                </StackPanel>
            </Button>
            <Button x:Name="CancelButton" Click="CancelButton_Click">
                <StackPanel>
                    <Image Source="../Resources/Accept.png" Margin="0,0,5,0"/>
                    <TextBlock Text="关闭"/>
                </StackPanel>
            </Button>
        </StackPanel>
    </Grid>
</controls:ChildWindow>